package net.zdreamer.geracomium.adapter;

import java.util.List;

import net.zdreamer.geracomium.entity.GeracomiumReserveInfos.AreaInfos;
import net.zdreamer.geracomium.utils.window.ViewControlor;
import net.zdreamer.geracomium.utils.tools_utils.ViewHolder;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import android.widget.TextView;

import com.example.geracomium.R;

public class ReserveAdapter extends MyBaseAdapter<AreaInfos> {
	private AreaInfoAdapter mAreaInfoAdapter;

	public ReserveAdapter(Context context, List<AreaInfos> list, int res) {
		super(context, list, res);
	}

	@Override
	protected View getView(int position, View convertView, ViewGroup parent,
			AreaInfos value) {
		TextView areaNum = ViewHolder.get(convertView, R.id.area_num);
		TextView areaAll = ViewHolder.get(convertView, R.id.area_all);
		ListView listView = ViewHolder.get(convertView, R.id.listview_area);
		mAreaInfoAdapter = new AreaInfoAdapter(getmContext(), value.areaInfos, R.layout.area_details);
		listView.setAdapter(mAreaInfoAdapter);
		ViewControlor.setListViewHeightBasedOnChildren(listView);
		areaNum.setText(value.areaName);
		areaAll.setOnClickListener(new View.OnClickListener(){
			@Override
			public void onClick(View v) {
				
			}
		});
		return convertView;
	}
	
	
}
